const v2Router = require('express').Router()

const UserRouter = require('./user.router')
const AuthRouter = require('./auth.router')
const TestRouter = require('./test.router')
const GoodsRouter = require('./goods.router')
const fs = require("fs");
/**
 * v2 after route
 */

let v2RootHandle = function (req, res) {
    let self = fs.readFileSync(__filename, {encoding: 'utf8'})
    res.status(200).send(self.toString())
}

v2Router.get('/',v2RootHandle)

// 每个实例化后的对象都携带了routes 导出给app use 一下即可
new UserRouter(v2Router)
new AuthRouter(v2Router)
new TestRouter(v2Router)
new GoodsRouter(v2Router)

module.exports = v2Router
